<?php

namespace App\Http\Resources;

//use Illuminate\Http\Resources\Json\ResourceCollection;
use Illuminate\Http\Resources\Json\JsonResource;
use App\Helpers\JsonApiResponseData;
class ShopGoodsCollection extends JsonResource
{
    use JsonApiResponseData;
    /**
     * Transform the resource collection into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
     */
    public function toArray($request)
    {
        return [
            'value'=>$this->id,
            'label'=>$this->title,
        ];
    }
    public function toString($data){
        return (string)$data;
    }
}
